// =====================================================
// This function helps the inherit code is easier to
// write.
// =====================================================
Function.prototype.InheritsFrom = function( parentClassOrObject )
{ 
	if ( parentClassOrObject.constructor == Function ) 
	{ 
		// Normal Inheritance: inherit from a class
		this.prototype = new parentClassOrObject;
		this.prototype.constructor = this;
		this.prototype.parent = parentClassOrObject.prototype;
	} 
	else 
	{ 
		// Pure Virtual Inheritance: inherit from an object (normaly won't use)
		this.prototype = parentClassOrObject;
		this.prototype.constructor = this;
		this.prototype.parent = parentClassOrObject;
	} 
	return this;
} 